package com.hsylient.config;

import com.hsylient.entity.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

@Configuration
@ComponentScan("com.hsylient.entity")
public class AppConfig {

    @Bean
    @Profile("dev")
    public Student profileA() {
        Student student = Student.builder()
                .id(1001)
                .name("开发环境")
                .build();
        return student;
    }

    @Bean
    @Profile("test")
    public Student profileB() {
        Student student = Student.builder()
                .id(1001)
                .name("测试环境")
                .build();
        return student;
    }
}
